﻿#region << 文件说明 >>

/*----------------------------------------------------------------
 * 命名空间：Vampirewal.Core.Models.FlowEngine
 * 唯一标识：6e8634c9-2942-472d-b048-3d40298cdcac
 * 文件名：FlowWorkInfo
 *
 * 创建者：杨程
 * 电子邮箱：235160615@qq.com
 * 创建时间：2023/10/13 17:18:12
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/

#endregion << 文件说明 >>

namespace Vampirewal.Core.Models.FlowEngine;

/// <summary>
/// 流程引擎Work信息
/// </summary>
[SugarTable("Work_WorkInfo", tableDescription: "工作流程表")]
public class FlowWorkInfo : TopModel
{
    /// <summary>
    /// 构造函数
    /// </summary>
    public FlowWorkInfo()
    {
    }

    /// <summary>
    /// 主键
    /// </summary>
    [SugarColumn(IsPrimaryKey = true, Length = 50)]
    public string WorkId { get; set; }

    /// <summary>
    /// 流程ID
    /// </summary>
    [SugarColumn(ColumnDescription = "流程ID", Length = 50)]
    public string FlowId { get; set; }

    /// <summary>
    /// 描述
    /// </summary>
    [SugarColumn(ColumnDescription = "描述", IsNullable = true)]
    public string Description { get; set; }

    /// <summary>
    /// 开始人
    /// </summary>
    [SugarColumn(ColumnDescription = "开始人", IsNullable = true)]
    public string Startor { get; set; }

    /// <summary>
    /// 开始时间
    /// </summary>
    [SugarColumn(ColumnDescription = "开始时间", IsNullable = true)]
    public DateTime? StartTime { get; set; }

    /// <summary>
    /// 结束时间
    /// </summary>
    [SugarColumn(ColumnDescription = "结束时间", IsNullable = true)]
    public DateTime? FinishTime { get; set; }

    /// <summary>
    /// 流程执行状态
    /// </summary>
    [SugarColumn(ColumnDescription = "流程执行状态", IsNullable = true)]
    public WorkStateType State { get; set; }
}

/// <summary>
/// 工作流状态枚举
/// </summary>
public enum WorkStateType
{
    /// <summary>
    /// 执行中
    /// </summary>
    Running = 0,

    /// <summary>
    /// 已结束
    /// </summary>
    Finished = 1,

    /// <summary>
    /// 作废
    /// </summary>
    Abolish = 2
}